 //
//  HomeFinanceCell.m
//  BrushFace
//
//  Created by timer_q on 15/12/14.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "HomeFinanceCell.h"
#import "ARViewHepler.h"
#import "NavHelper.h"

@implementation HomeFinanceCell
{
    __weak IBOutlet UIImageView *statuImage;
    __weak IBOutlet UILabel *statuLabel;


}
- (void)awakeFromNib {
    // Initialization code
    
    
   
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.iconButton.layer.cornerRadius = self.iconButton.frame.size.width/2.0;
    self.iconButton.clipsToBounds = YES;
    self.friendImageView.layer.borderWidth = 0.5;
    self.friendImageView.layer.borderColor = self.friendImageView.textColor.CGColor;
    self.friendImageView.layer.cornerRadius = 2;
    self.friendImageView.clipsToBounds = YES;
    
}
- (void)cellSetPrecent:(CGFloat)precent{
    for (UIView *view in self.animateView.subviews) {
        [view removeFromSuperview];
    }
    [self.animateView loadSubViewWithFrame:self.animateView.frame];
    self.animateView.layer.cornerRadius = self.animateView.frame.size.height/2.0;
    [self.animateView setPrecent:precent description:@"" textColor:[UIColor whiteColor] bgColor:UIColorFromRGB(0xfed047) alpha:1 clips:YES];
    [self.animateView addAnimateWithType:1];
    self.animateView.endless = YES;

    

}
- (void)setCurrentType:(NSInteger)currentType{
    if (currentType == AR_BORROW_ING||currentType==0||currentType==11||currentType==12) {
        statuImage.hidden = YES;
        _animateView.hidden = NO;
        statuLabel.hidden = YES;
    }else{
        _animateView.hidden = YES;
        statuLabel.hidden = NO;
        statuImage.hidden = NO;
        switch (currentType) {
            case AR_FULL:case 700:
            {
                statuImage.image = [UIImage imageNamed:@"manbiao"];
                statuLabel.text = @"已满标";
            }
                break;
            case AR_FAIL:case 6:
            {
                statuImage.image = [UIImage imageNamed:@"liubiao"];
                statuLabel.text = @"已流标";
            }
                break;
            case AR_ED:case 10:
            {
                statuImage.image = [UIImage imageNamed:@"yihuan"];
                statuLabel.text = @"已还款";
            }
                break;
            case AR_OUT_DATE:
            {
                statuImage.image = [UIImage imageNamed:@"yuqi"];
                statuLabel.text = @"已逾期";
            }
                break;
            case AR_REFUND_ING:case 3:case 9:case 13:
            {
                statuImage.image = [UIImage imageNamed:@"huankuaning"];
                statuLabel.text = @"还款中";
            }
                break;
            default:
                break;
        }
        
    }
    
}
- (IBAction)iconBtnClick:(id)sender {
    [NavHelper gotoContactDetailVCWithUserId:self.userid];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
